<!DOCTYPE html>
<html>

<head>
  <title>DOM</title>
</head>

<body>
  <script type="text/javascript">
    function msg() {
      alert("document.form1.name.value = " + document.form1.guest_name.value);
      alert("document.getElementById = " + document.getElementById("guest_id").value);
      alert("document.getElementsByName = " + document.getElementsByName("guest_name")[0].value);
      alert("document.getElementsByClassName = " + document.getElementsByClassName("input_guest")[0].value);
      alert("document.getElementsByTagName = " + document.getElementsByTagName("input")[0].value);

      document.getElementById("myHtml").innerHTML = "<b>Hello Coding Man</b>";
      document.getElementById("myText").innerText = "Hello Coding Man";
      
    }  
  </script>
  <form name="form1">
    Enter Name:
    <input type="text" class="input_guest" id="guest_id" name="guest_name" />
    <input type="button" onclick="msg()" value="Click" />
  </form>
  <span id="myHtml">no content</span><br/>
  <span id="myText">no content</span><br/>
</body>

</html>